package com.jiefutong.zyt;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;

import com.zhy.autolayout.AutoLayoutActivity;

public class BackPassordActivity extends AutoLayoutActivity {
    private EditText accountET;
    private ImageView clearIV;
    private Button nextBtn;
    private ImageView backBtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_back_passord);
        initView();
        clearIV.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                accountET.setText(null);
            }
        });

        nextBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(TextUtils.isEmpty(accountET.getText().toString())){
                    Toast.makeText(getBaseContext(), "请输入您的账号", Toast.LENGTH_LONG).show();
                    return;
                }
                Intent intent=new Intent(BackPassordActivity.this,BackCodeActivity.class);
                intent.putExtra("userMobile",accountET.getText().toString());
                startActivity(intent);
            }
        });
    }

    private void initView() {
        backBtn=findViewById(R.id.back_btn);
        backBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
         accountET=findViewById(R.id.backPassword_accountET);
         clearIV=findViewById(R.id.backPassword_clearIV);
         nextBtn=findViewById(R.id.backPassword_nextBtn);
    }
}
